<?php
namespace app\admin\controller;

class Index extends MyController
{
    public function index()
    {
        //会员总数
        $member = db('user')->count('u_id');
        $hour = date('H');
//        halt($hour);
        if ($hour<6){
            $hello = "已经凌晨了，注意休息！";
        }elseif ($hour>=6 && $hour<9){
            $hello = "早上好，";
        }elseif ($hour>=9 && $hour<13){
            $hello = "中午好，";
        }elseif($hour>=13 && $hour<19){
            $hello = "下午好，";
        }else{
            $hello = "晚上好，";
        }

        $this->assign([
            'member'=>$member,
            'hello' => $hello,
        ]);
        return view();
    }
}
